package com.CGFrame.struts.bean;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class CommonBean{

	public String nowTime()
	{
		try
		{
			int iYear=1980,iMonth=1,iDay=1;
			String sYear="",sMonth="",sDay="",currentTime="",temp="";
			GregorianCalendar calendar = new GregorianCalendar();
			iYear = calendar.get(Calendar.YEAR);
			iMonth = calendar.get(Calendar.MONTH)+1;
			iDay = calendar.get(Calendar.DAY_OF_MONTH);
			
			sYear = String.valueOf(iYear);
			sMonth = String.valueOf(iMonth);
			sDay = String.valueOf(iDay);
			if(iMonth<10)
			{
				temp="0"+sMonth;
				sMonth=temp;
			}
			if(iDay<10)
			{
				temp="0"+sDay;
				sDay=temp;
			}
			currentTime=sYear+"-"+sMonth+"-"+sDay;
			return currentTime;
		}
		catch(Exception e)
		{
		 
		}
		return "null";
		
	}
	
}